package xyz.jcat.seata.example.bussiness.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import xyz.jcat.common.web.Resp;
import xyz.jcat.seata.example.api.dto.SaleDto;
import xyz.jcat.seata.example.bussiness.service.IBussinessService;

@RestController
public class BussinessController {

    @Autowired
    private IBussinessService bussinessService;

    @PostMapping("/sale")
    public Resp sale(@RequestBody SaleDto saleDto) {
        bussinessService.sale(saleDto);
        return Resp.ok();
    }
}
